<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tags标签管理 HDSysCms</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="<?php echo getcdnurlhost() ?>/admin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="<?php echo getcdnurlhost() ?>/admin/style/admin.css" media="all">
<link rel="stylesheet" href="<?php echo getcdnurlhost() ?>/admin/style/template.css" media="all">
<style>.hdsys-box {display: flex;}.hdsys-bin-box {padding-top: 5px;min-width: 80px;height: 40px;}.hdsys-bins-show {padding-right: 10px;float: left;}.hdsys-box-show-in {display: block;}.hdsys-box:hover .hdsys-bins-show,.hdsys-box:active .hdsys-bins-show,.hdsys-box:focus .hdsys-bins-show {display: block;}</style>
</head>
<body data="HDSYSCMS 2021本系统受国家版权局保护请勿破解或者二次开发传播">
<div class="layui-col-md12">
<div style="padding-left: 10px;line-height: 35px;" class="layui-card">
<span class="layui-breadcrumb">
<a href="">模版管理</a>
</span>
</div>
</div>
<div class="layui-fluid layadmin-maillist-fluid">
<div class="layui-row layui-col-space15">
<div class="layui-bins">
<button class="layui-btn layui-btn-sm  bin-add" id="bin-up" lay-event="bin-up"><i class="layui-icon layui-icon-add-circle-fine"></i>导入模版Zip压缩包</button>
</div>
<?php
$path=HDSYS_DIR_SYS . 'templates';
$temp_array=open_list_dir_t($path);
foreach ($temp_array as $param_value) {
if (is_dir($path . '/' . $param_value)) {
$param_josn_array=call_my_get_templates_info($param_value);
?>
<div class="layui-col-md6 layui-col-sm12">
<div style="<?php echo bs_lib::get_configs_value('template', 'current')==$param_value ? "border: 1px solid #1f87f29c; border-radius: 5px;  box-sizing: border-box;" : ""; ?>" class="layadmin-contact-box hdsys-box">
<div>
<style>.logos {width: 235px;height: 165px;border: #EEEEEE;border-style: solid;border-width: 1px;}</style>
<img title="<?php echo $param_josn_array['info']; ?>" class="logos" src="<?php
if (file_exists(HDSYS_DIR_SYS . "/templates/{$param_value}/statics/templatesBy.png")) {
echo "../templates/{$param_value}/statics/templatesBy.png";
} else {
echo '../statics/no.png';
}
?>">
</div>
<div class="layadmin-padding-left20">
<p atl="模版位置:根目录/templates/<?php echo $param_value ?>" class="layadmin-textimg">
<i class="layui-icon layui-icon-export"></i>
模版名称:<?php echo $param_josn_array['name']=="" ? $param_value : $param_josn_array['name'];  ?>
</p>
<p atl="模版位置:根目录/templates/<?php echo $param_value ?>" class="layadmin-textimg">
<i class="layui-icon layui-icon-location"></i>
模版目录:
<?php
echo $param_value;
?>
</p>
<div class=" hdsys-bin-box caller-item">
<?php
if (bs_lib::get_configs_value('template', 'current')==$param_value or bs_lib::get_configs_value('template', 'current_en')==$param_value) {
$param_is=1;
} else {
$param_is=0;
}
?>
<div style="<?php echo $param_is ? "display: block;" : ""; ?>" class="hdsys-bins-show  caller-fr ">
<button lay-submit val="<?php echo $param_value ?>" class="layui-btn layui-btn-sm layui-btn-primary <?php echo $param_is ? "layui-border-blue " : ""; ?> set-down-bin"><i class="layui-icon layui-icon-template-1"></i>
<?php
if (bs_lib::get_configs_value('template', 'current')==$param_value and bs_lib::get_configs_value('template', 'current_en')==$param_value) {
echo "中英文默认模版";
} else if (bs_lib::get_configs_value('template', 'current')==$param_value) {
echo "中文默认模版";
} else if (bs_lib::get_configs_value('template', 'current_en')==$param_value) {
echo "英文默认模版";
} else {
echo "设为默认模版";
}
?></button>
</div>
<div class="hdsys-bins-show  caller-fr ">
<button class="layui-btn layui-btn-sm " onclick="window.location.href='index.php?m=manage&c=Ad&a=document&id=<?php echo $param_value ?>';"><i class="layui-icon layui-icon-app"></i>模版信息</button>
</div>
<?php
$param_arr=call_my_is_visualization($param_value);
if ($param_arr['code']==2) { ?>
<div class="hdsys-bins-show  caller-fr ">
<button class="layui-btn layui-btn-sm caller-fr  " onclick="window.open('index.php?m=manage&c=Div&a=Template&id=<?php echo $param_value ?>');"><i class="layui-icon layui-icon-template"></i>可视化编辑</button>
</div>
<?php } elseif ($param_arr['code']==1) {
?>
<div class="hdsys-bins-show  caller-fr ">
<button class="layui-btn layui-btn-sm caller-fr  " onclick="window.location.href='index.php?m=manage&c=Ad&a=table&id=<?php echo $param_value ?>';"><i class="layui-icon layui-icon-form"></i>动态标签</button>
</div>
<?php
} else {
?>
<div class="hdsys-bins-show  caller-fr ">
<?php echo $param_arr['msg']; ?>
</div>
<?php
}
?>
</div>
</div>
</div>
</div>
<?php
}
}
?>
</div>
</div>
<style>.hdsys-bin-box .layui-btn {margin-top: 10px;}</style>
<?php adminechohtnl(); ?>
<div id="foot">Copyright © 2019-2023 <a href="https://www.HDSysCms.Com?pro" target="_blank">HDSysCms <?php echo HDSYS_VERSION; ?></a> <br>
All Rights Reserved </div>
<script src="<?php echo getcdnurlhost() ?>/admin/layui/layui.js"></script>
<script>layui.config({base: '<?php echo getcdnurlhost() ?>/admin/'}).extend({index: 'lib/index'}).use(['jquery', 'index', 'dropdown', 'form', 'layer', 'upload'], function() {var admin=layui.admin,$=layui.$,upload=layui.upload,form=layui.form;var dropdown=layui.dropdown;dropdown.render({elem: '.set-down-bin',data: [{title: '设置中文默认模版',id: 'zh'}, {title: '设置英文默认模版',id: 'en'}],click: function(obj) {var dir_name=$(this.elem).attr("val");$.ajax({type: "post",url: 'index.php?m=manage&c=<?php echo set_get("c") ?>&a=set_template',data: 'dir_name=' + dir_name + "&template=" + obj.id,dataType: "json",success: function(ret) {layer.msg(ret.msg);window.location.reload();},error: function(e, t) {layer.alert('接口请求返还异常');}});}});var uploadInst_album=upload.render({elem: '#bin-up',url: 'index.php?m=manage&c=Template&a=up_ajax',accept: 'file',field: 'file',exts: 'zip',auto: true,before: function(obj) {layer.load(0);},done: function(res) {layer.closeAll();if (res.code==1000) {layer.confirm(res.msg, {btn: ['确定']}, function() {window.location.reload();});} else {layer.alert(res.msg)}},error: function() {layer.closeAll();layer.alert('上传失败')}});$(".HDSYSCMS-SET").click(function() {var dir_name=$(this).attr("val");$.ajax({type: "post",url: 'index.php?m=manage&c=<?php echo set_get("c") ?>&a=set_template',data: 'dir_name=' + dir_name,dataType: "json",success: function(ret) {layer.msg(ret.msg);window.location.reload();},error: function(e, t) {layer.alert('接口请求返还异常');}});return false;});});</script>
</body>
</html>